package routes

import (
	"doctor_api_backend/controller"

	"github.com/gin-gonic/gin"
)

// 设置医嘱相关路由
func SetupMedicalOrderRoutes(authorizedGroup *gin.RouterGroup) {
	// 医嘱管理
	medicalOrderGroup := authorizedGroup.Group("/medical_orders")
	{
		// 创建医嘱
		medicalOrderGroup.POST("", controller.CreateMedicalOrder)
		// 通过医嘱id查询医嘱
		medicalOrderGroup.GET("/:id", controller.GetMedicalOrder)
		// 通过医嘱id更新医嘱
		medicalOrderGroup.PUT("/:id", controller.UpdateMedicalOrder)
		// 通过医嘱id删除医嘱
		medicalOrderGroup.DELETE("/:id", controller.DeleteMedicalOrder)
		// 查询所有医嘱
		medicalOrderGroup.GET("", controller.GetAllMedicalOrders)
		// 通过病人id查询病人医嘱
		medicalOrderGroup.GET("/patient/:id", controller.GetPatientMedicalOrders)
		// 通过医生id查询医生医嘱
		medicalOrderGroup.GET("/doctor/:id", controller.GetDoctorMedicalOrders)
	}
}
